Skip to content

Security: Raw exception messages are returned to clients in throttling middleware#3296

Open
tomaioo wants to merge 1 commit intonextcloud:mainfrom
tomaioo:fix/security/raw-exception-messages-are-returned-to-c
Open

Security: Raw exception messages are returned to clients in throttling middleware#3296
tomaioo wants to merge 1 commit intonextcloud:mainfrom
tomaioo:fix/security/raw-exception-messages-are-returned-to-c

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 15, 2026

Summary

Security: Raw exception messages are returned to clients in throttling middleware

Problem

Severity: Medium | File: lib/Middleware/ThrottleFormAccessMiddleware.php:L21

In afterException, the middleware returns $exception->getMessage() to the client for NoSuchFormException. If exception messages include internal identifiers, query context, or untrusted input, this can lead to information disclosure and potentially reflected content issues in consuming clients.

Solution

Return a fixed, generic error message (e.g., 'Form not found') and log detailed exception context server-side only.

Changes

  • lib/Middleware/ThrottleFormAccessMiddleware.php (modified)

In `afterException`, the middleware returns `$exception->getMessage()` to the client for `NoSuchFormException`. If exception messages include internal identifiers, query context, or untrusted input, this can lead to information disclosure and potentially reflected content issues in consuming clients.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/Middleware/ThrottleFormAccessMiddleware.php 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant